#!/bin/bash

# curl -sSfL https://gitee.com/sunnybug/pubshell/raw/main/root_tool/source_list.sh | bash

set -e

# 检查当前系统是否为 Debian bookworm
if ! grep -q 'VERSION_CODENAME=bookworm' /etc/os-release; then
    echo "错误：仅支持 Debian bookworm 版本。"
    exit 1
fi

# 设置国内阿里云镜像源
cat > /etc/apt/sources.list <<EOF
deb http://mirrors.aliyun.com/debian/ bookworm main contrib non-free
deb http://mirrors.aliyun.com/debian/ bookworm-updates main contrib non-free
deb http://mirrors.aliyun.com/debian-security bookworm-security main contrib non-free
EOF

echo "已将镜像源设置为阿里云 Debian bookworm 国内源。"
